<?php
/**
 * 
 * @author Paolo Bertuzzo
 *
 */
namespace Catalog\Data;

class CollectionDao extends AbstractDao
{
    
    /**
     * 
     * @param integer $pageSize
     */
    public function getAdvertised($pageSize)
    {
        $query = $this->entityManager->createQuery('select c from Catalog\Entity\Collection c where c.isAdvertised = true ' .
            ' order by c.advertisingPriority desc');
        
        $query->setMaxResults($pageSize);        
        $query->useResultCache(true);
        
        return $query->getResult();
    }    
    
}

?>